﻿<button type="button" class="btn btn-success" id="GetByFromQuery">GetByFromQuery</button>
<script type="text/javascript">
    $(() => {
        $("#GetByFromQuery").click(function () {
            let ajaxRequest = new XMLHttpRequest();
            ajaxRequest.open('get', '/api/HttpVerb/GetByFromQuery?name=tom&age=19');
            ajaxRequest.setRequestHeader('appkey', 'appkey12345');
            ajaxRequest.setRequestHeader('appsecret', 'appsecrte12345');
            ajaxRequest.setRequestHeader('sign', 'sign12345');
            let formData = new FormData();
            ajaxRequest.send();
            ajaxRequest.onreadystatechange = function () {
                if (this.readyState == 4 && this.status == 200) {
                    console.log(ajaxRequest.responseText);
                }
            };
        });
    });
</script>



<button type="button" class="btn btn-success" id="PutByFormQuery">PutByFormQuery</button>
<script type="text/javascript">
    $(() => {
        $("#PutByFormQuery").click(function () {
            let ajaxRequest = new XMLHttpRequest();
            ajaxRequest.open('put', '/api/HttpVerb/PutByFormQuery?id=15', true);
            ajaxRequest.setRequestHeader('appkey', 'appkey12345');
            ajaxRequest.setRequestHeader('appsecret', 'appsecrte12345');
            ajaxRequest.setRequestHeader('sign', 'sign12345');
            ajaxRequest.setRequestHeader('Content-type', 'application/x-www-form-urlencoded; charset=utf-8');
            ajaxRequest.send('name=tom&age=18');
            ajaxRequest.onreadystatechange = function () {
                if (this.readyState == 4 && this.status == 200) {
                    console.log(ajaxRequest.responseText);
                }
            };
        });
    });
</script>



<button type="button" class="btn btn-success" id="PatchByFromForm">PatchByFromForm</button>
<script type="text/javascript">
    $(() => {
        $("#PatchByFromForm").click(function () {
            let ajaxRequest = new XMLHttpRequest();
            ajaxRequest.open('patch', '/api/HttpVerb/PatchByFromForm?id=15', true);
            ajaxRequest.setRequestHeader('appkey', 'appkey12345');
            ajaxRequest.setRequestHeader('appsecret', 'appsecrte12345');
            ajaxRequest.setRequestHeader('sign', 'sign12345');
            ajaxRequest.setRequestHeader('Content-type', 'application/x-www-form-urlencoded; charset=utf-8');

            let data=new FormData();
            data.append('name','tom');
            data.append('age','15');

            ajaxRequest.send("name=tom&age=18");
            ajaxRequest.onreadystatechange = function () {
                if (this.readyState == 4 && this.status == 200) {
                    console.log(ajaxRequest.responseText);
                }
            };
        });
    });
</script>